/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.totoland.db.report.dao.hibernate;

import com.totoland.db.dao.BaseDao;
import com.totoland.db.report.dao.ReportViewSummaryDao;
import com.totoland.db.report.entity.ViewSummary;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author Totoland
 */
@Repository
public class ReportViewSummaryDaoImpl extends BaseDao implements ReportViewSummaryDao {

    @Override
    @Transactional
    public ViewSummary getViewSummay() {
        return (ViewSummary) findUniqNativeQuery("SELECT (SELECT COUNT(1) FROM StudentInfo WHERE ImagePath is null) AS NOT_CUPTURE, "
                + "(SELECT COUNT(1) FROM StudentInfo WHERE ImagePath is not null) AS CUPTURED, "
                + "(SELECT COUNT(1) FROM StudentInfo) AS ALL_CUPTURE", ViewSummary.class);
    }

}
